body {
    font-family: eb-garamond;
    background-color: #f8f8f8;
    margin: 0;
    padding: 20px;
}
.header {
    display: flex;
    justify-content: flex-end;
    padding: 10px;
}

.container {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 20px;
}
.left-section {
    display: flex;
    flex-direction: column;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    width: 70%;
    align-items: flex-start;
    justify-content: flex-start;
    position: relative;
    min-height: 100vh;
}
.right-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 30%;
    min-height: 100vh;
    overflow-y: auto;
}
.overview, .instructions {
    display: flex;
    flex-wrap: wrap;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    flex-grow: 1;
}
.title {
    font-size: large;
    font-weight: bold;
    font-family: eb-garamond;
}
.overview { background-color: #d8e3ff; }
.instructions { background-color: #ffd8f0; display: flex; flex-direction: column; }
.pre-activity { background-color: #ffe4b3; }

ul {
    padding-left: 20px;
}


.content{
    font-family: eb-garamond;
    font-size: large;
}


#controls {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    align-items: center;
    align-self: flex-start;
    justify-content: center;
    position: relative;
    gap: 10px;
    width: 100%; 
}

#speed-control {
    display: flex;
    align-items: center; 
    justify-content: center; 
    gap: 5px;
    margin-bottom: 10px;
}

#element{
    border-radius: 5px;
    margin-right: 10px;
    margin-bottom: 10px;
    margin-left: 10px;
    width: 270px;
    min-height: 40px;
    min-width: 20px;
}

button {
    padding: 10px 15px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    border-radius: 5px;
    margin-left: 10px;
    margin-top: 5px;
}

.row {
    display: flex;
    justify-content: center;
    margin: 10px 5px;
    gap: 20px;
}
.segment {
    display: flex;
    gap: 5px;
}
.box {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid black;
    background-color: lightblue;
}

#merge_sort_container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%; 
    min-height: 300px; 
}
.random {background: rgb(71, 101, 142); color: white;}
.sort {background: rgb(39, 55, 128); color: white;}
.reset {background-color: rgb(57, 57, 106); color: white;}

#error-message {
    color: red;
    font-size: 18px; 
    margin-top: 8px;
    text-align: center; 
    opacity: 0;
    transition: opacity 0.3s ease;
    height: 24px; 
}

button.disabled {
    opacity: 0.5; 
    cursor: not-allowed; 
    pointer-events: none; 
}

@media(max-width : 800px)
{
    .container{
        flex-direction: column;
        height: auto;
    }

    .left-section{
        width: 100%;
    }

    .right-section{
        width: 100%;
    }

    .overview, .instructions{
        width: 100%;
        display: block;
    }

}
@media(max-width : 330px)
{
    body{
        padding: 0px;
        border-radius: 0;
    }

    .left-section, .overview, .instructions{
        border-radius: 0;
    }
}

@media (max-width: 400px) {

    #error-message{
        font-size: 16px;
    }
}
